<template>
  <page-form :x-uri="uri" :x-tabs="tabs" :reset-btn-text="false" :bind-rules="rules" :custom-components="custom" />
</template>

<script>
import PageForm from '@public/template/page_form.vue';
import Status from './components/status.vue';
export default {
  components: {
    PageForm
  },
  data() {
    const validator = [
      { required: true, message: '机构分成比例必须填写', trigger: ['blur', 'change'] },
      {
        pattern: /^\d+(\.\d{1,2})?$/,
        message: '分成比例只能为正整数或2位以下小数',
        trigger: ['blur', 'change']
      }
    ];
    return {
      uri: '/admin/market/split/config',
      tabs: [
        {
          title: '分成配置',
          uri: '/market/split/config',
          meta: {
            permission: 'market.split.config'
          }
        }
      ],
      rules: {
        platform: validator,
        school: validator,
        mount_school: validator,
        teacher: validator,
        share: validator,
        distributor_first: validator,
        distributor_second: validator
      },
      custom: {
        status: Status
      }
    };
  }
};
</script>
